package own.stu.jobgib.playown.netty.promise;

import io.netty.util.concurrent.DefaultEventExecutor;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.UnorderedThreadPoolEventExecutor;

import java.util.concurrent.TimeUnit;

public class PromiseDemo {
    public static void main(String[] args) throws Exception {

        UnorderedThreadPoolEventExecutor executors = new UnorderedThreadPoolEventExecutor(2);
//        executors.newPromise()
    }

    private void defaultEventExecutorTest() throws Exception {
        DefaultEventExecutor executor = new DefaultEventExecutor();
        Future<?> submit = executor.submit(() -> {
            System.out.println("-----");
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        submit.await();
        executor.shutdownGracefully();
    }
}
